package com.aspose.cells;

class zpt implements zagn {
   private ziw j;
   private boolean k;
   private boolean l;
   private boolean m;
   private boolean n;
   private boolean o;
   private boolean p;
   private int q;
   private int r;
   private int s;
   private int t;
   private int u;
   private boolean v = true;
   private String w = "";
   private boolean x;
   private String y;
   private zbam z = new zbam();
   com.aspose.cells.b.a.b.zq a;
   com.aspose.cells.b.a.b.zq b;
   com.aspose.cells.b.a.b.zq c;
   private String A = "";
   private boolean B = false;
   private int C = 0;
   private boolean D = true;
   com.aspose.cells.b.a.b.zo d = com.aspose.cells.b.a.b.zo.a();
   com.aspose.cells.b.a.b.zo e = com.aspose.cells.b.a.b.zo.a();
   com.aspose.cells.b.a.b.zo f = com.aspose.cells.b.a.b.zo.a();
   double g;
   boolean h = false;
   double i = 0.0D;
   private boolean E = false;
   private static final com.aspose.cells.b.c.a.za F = new com.aspose.cells.b.c.a.za(new String[]{", ", ". ", "; ", " ", "\n"});

   zpt(zif var1, Object var2, int var3) {
      this.j = new ziw(var1, var2, var3);
      this.k = false;
      this.l = false;
      this.m = false;
      this.n = false;
      this.o = false;
      this.p = false;
      this.q = 0;
      this.r = 0;
      this.s = 0;
      this.t = 1;
      this.u = 1;
      this.y = null;
      this.z = new zbam();
   }

   ziw a() {
      return this.j;
   }

   public zagc b() {
      return this.j;
   }

   boolean c() {
      if (this.s() != null && this.s().length() > 0) {
         return true;
      } else {
         return this.i() || this.d() || this.f() || this.h() || this.g();
      }
   }

   public boolean d() {
      return this.l;
   }

   public void a(boolean var1) {
      this.l = var1;
   }

   public boolean e() {
      return this.m;
   }

   public void b(boolean var1) {
      this.m = var1;
   }

   public boolean f() {
      return this.n;
   }

   public void c(boolean var1) {
      this.n = var1;
   }

   public boolean g() {
      return this.o;
   }

   public void d(boolean var1) {
      this.o = var1;
   }

   public boolean h() {
      return this.k;
   }

   public void e(boolean var1) {
      this.k = var1;
   }

   public boolean i() {
      return this.p;
   }

   public void f(boolean var1) {
      this.p = var1;
   }

   public int j() {
      return this.j.q() && this.j.r() ? this.q : 9;
   }

   public void a(int var1) {
      this.q = var1;
   }

   public int k() {
      return this.r;
   }

   public void b(int var1) {
      this.r = var1;
   }

   public String l() {
      if (this.k() != 0 && this.A != null && !"".equals(this.A)) {
         return this.A;
      } else {
         int var1 = this.a().y();
         return (var1 == 35 || var1 == 44) && this.d() && this.f() && !this.h() && !this.g() ? "\n" : ", ";
      }
   }

   public void a(String var1) {
      if (var1 != null && !"".equals(var1)) {
         switch(F.a(var1)) {
         case 0:
            this.b(2);
            break;
         case 1:
            this.b(4);
            break;
         case 2:
            this.b(3);
            break;
         case 3:
            this.b(1);
            break;
         case 4:
            this.b(5);
            break;
         default:
            this.b(6);
         }

         if (var1.length() > 255) {
            this.A = var1.substring(0, 255);
         } else {
            this.A = var1;
         }
      } else {
         this.b(0);
      }

   }

   public int m() {
      return this.s;
   }

   public void c(int var1) {
      this.s = var1;
   }

   public int n() {
      return this.t;
   }

   public void d(int var1) {
      this.t = var1;
   }

   public int o() {
      return this.u;
   }

   public void e(int var1) {
      this.u = var1;
   }

   public void g(boolean var1) {
      this.B = var1;
   }

   public void f(int var1) {
      this.C = var1;
   }

   public String p() {
      if (this.w.indexOf("E+") > 0) {
         return com.aspose.cells.b.a.zv.a(this.w, "E+", "E");
      } else {
         return this.w.indexOf("e+") > 0 ? com.aspose.cells.b.a.zv.a(this.w, "e+", "e") : this.w;
      }
   }

   public void b(String var1) {
      this.w = var1;
   }

   public boolean q() {
      return this.v;
   }

   public void h(boolean var1) {
      this.v = var1;
   }

   public boolean r() {
      return this.x;
   }

   public String s() {
      return this.y;
   }

   public void c(String var1) {
      this.y = var1;
   }

   boolean t() {
      if (this.s() != null && !"".equals(this.s())) {
         return true;
      } else if (this.h()) {
         return true;
      } else if (this.d()) {
         return true;
      } else if (this.g()) {
         return true;
      } else {
         zbcp var1 = null;
         if (this.j.b() instanceof zbcp) {
            var1 = (zbcp)this.j.b();
         } else if (this.j.b() instanceof zjd) {
            var1 = ((zjd)this.j.b()).g().a();
         }

         if (var1 != null && var1.ar() && this.f()) {
            return true;
         } else {
            return var1 != null && var1.au() && this.i();
         }
      }
   }

   public zahq u() {
      return this.z;
   }

   boolean v() {
      return this.z.getCount() > 0;
   }

   boolean w() {
      if (!this.h()) {
         return false;
      } else if (this.d()) {
         return false;
      } else if (this.g()) {
         return false;
      } else {
         zbcp var1 = null;
         if (this.j.b() instanceof zbcp) {
            var1 = (zbcp)this.j.b();
         } else if (this.j.b() instanceof zjd) {
            var1 = ((zjd)this.j.b()).g().a();
         }

         if (var1 != null && var1.ar() && this.f()) {
            return false;
         } else {
            return var1 == null || !var1.au() || !this.i();
         }
      }
   }

   int x() {
      boolean var1 = false;
      zbcp var2 = null;
      if (this.j.b() instanceof zbcp) {
         var2 = (zbcp)this.j.b();
      } else if (this.j.b() instanceof zjd) {
         var2 = ((zjd)this.j.b()).g().a();
      }

      int var3;
      if (var2 == null) {
         var3 = 27;
      } else if (var2.ak()) {
         var3 = 27;
      } else {
         var3 = this.D();
      }

      return var3;
   }

   private int D() {
      boolean var1 = false;
      float var2 = 0.0F;
      if (this.a().h().h() <= 6.0F) {
         var2 = 0.6F;
      } else {
         var2 = 0.465F;
      }

      if (this.a().h() != null) {
         int var3 = zbuk.c((double)(this.a().C() * var2));
         return var3 < 3 ? 3 : var3;
      } else {
         return 0;
      }
   }

   int y() {
      boolean var1 = false;
      if (this.a().h() != null) {
         int var2 = zbuk.c((double)this.a().C());
         return var2;
      } else {
         return 0;
      }
   }

   public void i(boolean var1) {
      this.D = var1;
   }

   boolean z() {
      return this.g > -4.71238898038469D && this.g < -1.5707963267948966D;
   }

   boolean A() {
      double var1 = 0.008697830681563268D;
      return this.g < var1 && this.g > -3.141592653589793D || this.g < -6.283185307179586D + var1;
   }

   int B() {
      double var1 = this.g * 180.0D / 3.141592653589793D;
      if ((var1 >= -292.5D || var1 < -337.5D) && (var1 >= 67.5D || var1 < 22.5D)) {
         if ((var1 >= -337.5D || var1 < -360.0D) && (var1 >= 22.5D || var1 < -22.5D)) {
            if (var1 < -22.5D && var1 >= -67.5D) {
               return 3;
            } else if (var1 < -67.5D && var1 >= -112.5D) {
               return 4;
            } else if (var1 < -112.5D && var1 >= -157.5D) {
               return 5;
            } else if (var1 < -157.5D && var1 >= -202.5D) {
               return 6;
            } else {
               return var1 < -202.5D && var1 >= -247.5D ? 7 : 8;
            }
         } else {
            return 2;
         }
      } else {
         return 1;
      }
   }

   protected void finalize() throws Exception {
      this.j(false);
   }

   public void C() {
      this.j(true);
      com.aspose.cells.b.a.zg.a(this);
   }

   protected void j(boolean var1) {
      if (!this.E) {
         if (var1) {
            if (this.j != null) {
               this.j.E();
            }

            if (this.z != null) {
               for(int var2 = 0; var2 < this.z.getCount(); ++var2) {
                  zbal var3 = this.z.b(var2);
                  if (var3 != null) {
                     var3.f();
                  }
               }
            }
         }

         this.E = true;
      }

   }
}
